<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends CommonController {
    public function index(){
    	$this->display();
    }
    public function Index_v1(){
        $firstday = date('Y-m-01',strtotime(date("Y-m-d")));
        $lastday = date('Y-m-d',strtotime("$firstday +1 month -1 day"));
        $condMemberMonth['reg_time'] = array('between',array(strtotime($firstday),strtotime($lastday)));
        $condMemberMonth['s_id'] = $_SESSION['seller']['user_id'];
        $resMemberMonth = D('member')->where($condMemberMonth)->count();
        $condMember['s_id'] = $_SESSION['seller']['user_id'];
        $resMember = D('member')->where($condMember)->count();
        $condOrder['seller_id'] = $_SESSION['seller']['user_id'];
        $condOrder['status'] = array('not in','0,11,50');
        $resOrder = D('order')->where($condOrder)->count();
        $condMoney['user_id'] = $_SESSION['seller']['user_id'];
        $resMoney = D('account')->where($condMoney)->sum('money');
        $array = array(
            'member_month' => $resMemberMonth,
            'member' => $resMember,
            'order' => $resOrder,
            'money' => $resMoney
        );
        $this->assign('count',$array);
        $this->display();
    }
}